﻿using Frameworks;
using UnityEngine;

public class LoginManager : MonoBehaviour
{
    private void Start()
    {
        //string account = SystemInfo.deviceUniqueIdentifier;
        string account = SystemInfo.deviceName;

        // 自动登录
        login(account);
    }

    private void login(string account)
    {
        UserData userData = new UserData();
        userData.id = 9999;
        userData.account = account;

        // 自动登录成功了
        onLoginSuccess(userData);
    }

    private void onLoginSuccess(UserData userData)
    {
        // 切换到大厅场景
        GameManager.SceneMgr.LoadSceneDirect("Lobby");
    }
}